package com.hdoit.kylin.web.group.modelconfig;

import com.hdoit.kylin.web.baseInfo.providers.SchoolIdProvider;
import com.hdoit.kylin.web.user.provider.TeacherProvider;
import com.tennetcn.common.enums.ManageContainer;
import com.tennetcn.component.attribute.DisplayNameAttribute;
import com.tennetcn.component.attribute.DropDownListAttribute;
import com.tennetcn.component.attribute.RemoteAttribute;
import com.tennetcn.component.attribute.RequiredAttribute;
import com.tennetcn.component.attribute.base.ModelMetadataAttributeConfiguration;

public class GroupConfig extends ModelMetadataAttributeConfiguration {
	public GroupConfig() {
		this.setProperty("groupName")
				.hasAttribute(new DisplayNameAttribute("课题组名称"))
				.hasAttribute(new RequiredAttribute("课题组名称为必填项"));
		this.setProperty("dutyId")
				.hasAttribute(new DisplayNameAttribute("负责人"))
				.hasAttribute(new RequiredAttribute("负责人为必填项"))
				.hasAttribute(new DropDownListAttribute(new TeacherProvider(),true));
		this.setProperty("schoolId")
				.hasAttribute(new DisplayNameAttribute("学校名称"))
				.hasAttribute(new RequiredAttribute("学校为必填项"))
				.hasAttribute(new DropDownListAttribute(new SchoolIdProvider()));
		this.setProperty("academyId")
				.hasAttribute(new DisplayNameAttribute("学院名称"))
				.hasAttribute(new RequiredAttribute("学院名称为必填项"));
		RemoteAttribute employeeAccountRemoteAttribute = new RemoteAttribute();
		employeeAccountRemoteAttribute
				.setAdditionalfields("*.employeeAccount,*.employeeId");
		employeeAccountRemoteAttribute.setErrorMessage("已经存在相应的账号");
		employeeAccountRemoteAttribute.setRemoteUrl(ManageContainer.VIRTUALPATH
				+ "/admin/user/teacher/checkAccount");

		this.setProperty("comments").hasAttribute(
				new DisplayNameAttribute("描述"));
		
		
//		this.setProperty("schoolName")
//		.hasAttribute(new DisplayNameAttribute("学校名称"))
//		.hasAttribute(new RequiredAttribute("学校为必填项"))
//		.hasAttribute(new DropDownListAttribute(new SchoolIdProvider()));
//	this.setProperty("academyName")
//		.hasAttribute(new DisplayNameAttribute("学院名称"))
//		.hasAttribute(new RequiredAttribute("学院名称为必填项"));

	}
}
